import Vue from "vue";

import Cookies from "js-cookie";

import "normalize.css/normalize.css"; // a modern alternative to CSS resets

import permission from "@/directive/permission/index.js"; // 权限判断指令

import Element from "element-ui";
import "./styles/element-variables.scss";

import "@/styles/index.scss"; // global css

import App from "./App";
import store from "./store";
import router from "./router";

// import './icons' // icon
import "./assets/icons"; // icon
import "./permission"; // permission control
import "./utils/error-log"; // error log

import * as filters from "./filters"; // global filters
import "@/icons/icon.css";

/**
 * If you don't want to use mock-server
 * you want to use MockJs for mock api
 * you can execute: mockXHR()
 *
 * Currently MockJs will be used in the production environment,
 * please remove it before going online ! ! !
 */
Vue.use(permission);
Vue.use(Element, {
  size: Cookies.get("size") || "medium", // set element-ui default size
});

// register global utility filters
Object.keys(filters).forEach((key) => {
  Vue.filter(key, filters[key]);
});

Vue.config.productionTip = false;

Vue.prototype.$imagePath = "http://localhost:8080/ejsimage"; // 静态资源，图片路径前缀  --- 服务器 ---
// Vue.prototype.$imagePath = "http://admin.yixiekeji.com/ejsimage"; // 静态资源，图片路径前缀  --- 服务器 ---
// Vue.prototype.$imageUrl = "http://admin.yixiekeji.com/api/"; // 图片请求接口地址  --- 服务器 ---
// Vue.prototype.$imageUrl = "http://localhost:9528/api/"; // 图片请求接口地址  --- 服务器 ---
Vue.prototype.postPath = "http://admin.yixiekeji.com/api/";

// Vue.prototype.$imagePath = "http://127.0.0.1:8080/ejsimage"; // 静态资源，图片路径前缀  --- 本地 ---
Vue.prototype.$imageUrl = "http://127.0.0.1:8081"; // 图片请求接口地址  --- 本地 ---
// 移动端H5地址
Vue.prototype.$h5Path = "http://bbch5.yixiekeji.com";
new Vue({
  el: "#app",
  router,
  store,
  render: (h) => h(App),
});
